package com.kagura.IOC;

import javax.naming.Name;

/**
 * @Classname Ioc
 * @Description TODO 依赖注入的类型
 * @Author 将烬星火是否太炽热, 明日黄花会开败阡陌
 * @Date 2021-08-08 上午 12:08
 * @Version 1.0
 **/
public class Ioc {

    private int id;
    private String username;
    private String pwd;

    // 使用setter方法注入属性

    public void setId(int id) {
        this.id = id;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    // 使用构造方法注入username、pwd属性
    public Ioc() {}

    public Ioc(String username, String pwd) {
        this.username = username;
        this.pwd = pwd;
    }

    public void print() {
        System.out.println(id + " -- " + username + " -- " + pwd);
    }
}
